<%-- 
    Document   : home
    Created on : Apr 10, 2012, 9:52:48 AM
    Author     : Yudi Retanto
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<jsp:include page="../header.jsp"></jsp:include>
<!-- Container -->
<script type="text/javascript">
    function updateProvinsi(){
        var id = $("#s-provinsi").val();
        if (id>0){
            $("#s-kabupaten").load("./unit?action=ajax&data=kabupaten&id_prov="+id);
        }
    }
</script>
<div id="container">
    <div class="shell">
        <!-- Main -->
        <div id="main">
            <div class="cl">&nbsp;</div>
            <!-- Content -->
            <div id="content" style="width:960px">
                <!-- Box -->
                <div class="box">
                    <!-- Box Head -->
                    <div class="box-head">
                        <h2 class="left">Laporan Data Surveilans</h2>
                    </div>
                    <!-- End Box Head -->	
                    <!-- Table -->
                    <div class="table">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <th>No</th>
                                <th>Tanggal</th>
                                <th>Nama Penyakit</th>
                            <c:choose>
                                <c:when test="${sessionScope.role ==1}">
                                    <th>Provinsi</th>
                                    <th>Kabupaten</th>
                                    <th>Unit</th>
                                </c:when>
                            </c:choose>
                            <th>Total Penderita</th>
                            <th width="110" class="ac">Pengaturan</th>
                            </tr>
                            <c:forEach items="${data}" var="d">
                                <c:set var="ordinal" value="${ordinal + 1}" />
                                <tr <c:if test="${(ordinal%2) == 1}">class="odd"</c:if>>
                                <td>${ordinal}</td>
                                <td><h3><a href="#">${d.getTanggal_str()}</a></h3></td>
                                <td>${d.getNama_penyakit()}</td>
                                <c:choose>
                                    <c:when test="${sessionScope.role ==1}">
                                        <td>${unitModel.getUnitProvinsi(d.getId_unit())}</td>
                                        <td>${unitModel.getUnitKabupaten(d.getId_unit())}</td>
                                        <td>${unitModel.getUnitNama(d.getId_unit())}</td>
                                    </c:when>
                                </c:choose>
                                <td>${d.getTotal()}</td>
                                <c:choose>
                                    <c:when test="${sessionScope.role ==1}">
                                        <td>
                                            <a href="./admin?action=delete_data&id=${d.getId()}" class="ico del">Delete</a>
                                            <a href="./admin?action=edit_data&id=${d.getId()}" class="ico edit">Edit</a>
                                        </td>
                                    </c:when>
                                    <c:when test="${sessionScope.role ==2}">
                                        <td>
                                            <a href="./unit?action=delete&id=${d.getId()}" class="ico del">Delete</a>
                                            <a href="./unit?action=edit&id=${d.getId()}" class="ico edit">Edit</a>
                                        </td>
                                    </c:when>
                                </c:choose>
                                </tr>
                            </c:forEach>
                        </table>
                    </div>
                    <!-- Table -->
                </div>
                <!-- End Box -->
            </div>
            <!-- End Content -->
            <div class="cl">&nbsp;</div>			
        </div>
        <!-- Main -->
    </div>
</div>
<!-- End Container -->
<jsp:include page="../footer.jsp"></jsp:include>